import request from "@/utils/request";

// 查询图书馆图书列表
export function listBook(query) {
  return request({
    url: "/library/boBook/list",
    method: "get",
    params: query,
  });
}

// 查询图书分类
export function getSelectBookType() {
  return request({
    url: "/library/boBook/getSelectBookType",
    method: "get",
  });
}

// 查询图书馆图书详细
export function getBook(id) {
  return request({
    url: "/library/boBook/" + id,
    method: "get",
  });
}

// 新增图书馆图书
export function addBook(data) {
  return request({
    url: "/library/boBook",
    method: "post",
    data: data,
  });
}

// 修改图书馆图书
export function updateBook(data) {
  return request({
    url: "/library/boBook",
    method: "put",
    data: data,
  });
}

// 删除图书馆图书
export function delBook(id) {
  return request({
    url: "/library/boBook/" + id,
    method: "delete",
  });
}

//根据图书编号查询图书
export function searchBooks(query) {
  return request({
    url: "/library/boBook/searchBooks",
    method: "get",
    params: query,
  });
}

//批量图书借阅
export function adds(data) {
  return request({
    url: "/library/boBorrow/adds",
    method: "post",
    data: data,
  });
}

//根据用户查询已借阅图书信息
export function selectReturnBooksByMembers(query) {
  return request({
    url: "/library/boBorrow/selectReturnBooksByMembers",
    method: "get",
    params: query,
  });
}

//批量图书批量归还
export function returnBooks(data) {
  return request({
    url: "/library/boBorrow/returnBooks",
    method: "post",
    data: data,
  });
}

//批量图书续期
export function continueBooks(data) {
  return request({
    url: "/library/boBorrow/continueBooks",
    method: "post",
    data: data,
  });
}
